package web.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 该类直接调用service方法，根据请求方式进行执行doGet或者doPost等方法
 * 我们只需要重写doGet和doPost方法
 * day09_Servlet_war_exploded
 * @author Mc.Chai
 * @program: JavaWeb
 * @create 2022-03-19-15:48 15:48
 */
@WebServlet("/httpDemo")
//@WebServlet({"/d","/dd","/ddd"})
//@WebServlet("*.do")
public class MyHttpServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("doGet start... ");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("doPost start...");
    }
}
